package com.javafactroy.kunlong.codefactroy.service.domain.valueobj;

import cn.hutool.core.util.StrUtil;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Data
public class ColsValueObj {
    //    	<result column="subsys_id" property="subsysId" jdbcType="INTEGER" /-->
    List<ColEqValueObj> colEqValueObjects;

    public ColsValueObj() {
        colEqValueObjects = new ArrayList<>();
    }

    public String toCodeString() {
        return StrUtil.join("\r\n",
                colEqValueObjects.stream().map(i->
                        i.getStringTemplate().parse(i.toCodeString())).collect(Collectors.toList()));
    }
}
